package com.kang.gaklibrary.model;

import com.kang.gaklibrary.util.MyUtil;

import java.util.Date;

public class User {
    private String userId;

    private String userPwd;

    private String userName;

    private Integer userSex;

    private Integer userAge;

    private String userQq;

    private String userTel;

    private String userLocation;

    private Integer userRole;

    private Date userDate;

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserPwd() {
        return userPwd;
    }

    public void setUserPwd(String userPwd) {
        this.userPwd = userPwd;
    }

    public String getUserName() {
        return userName;
    }

    // 需要的格式
    public String getFormatUserName(){
        if (getUserName() == null){
            return "未填写";
        }else {
            return getUserName();
        }
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Integer getUserSex() {
        return userSex;
    }

    // 将数据库的 0 1 格式转为 字符
    public String getFormatUserSex(){
        if(getUserSex() == null){
            return "未填写";
        }
        if (getUserSex() == 0){
            return "男";
        }else {
            return "女";
        }
    }

    public void setUserSex(Integer userSex) {
        this.userSex = userSex;
    }

    public Integer getUserAge() {
        return userAge;
    }

    public void setUserAge(Integer userAge) {
        this.userAge = userAge;
    }

    public String getUserQq() {
        return userQq;
    }

    public void setUserQq(String userQq) {
        this.userQq = userQq;
    }

    public String getUserTel() {
        return userTel;
    }

    public void setUserTel(String userTel) {
        this.userTel = userTel;
    }

    public String getUserLocation() {
        return userLocation;
    }

    // 需要的格式
    public String getFormatUserLocation(){
        if (getUserLocation() == null){
            return "未填写";
        }else {
            return getUserLocation();
        }
    }

    public void setUserLocation(String userLocation) {
        this.userLocation = userLocation;
    }

    public Integer getUserRole() {
        return userRole;
    }

    public void setUserRole(Integer userRole) {
        this.userRole = userRole;
    }

    public Date getUserDate() {
        return userDate;
    }

    // 得到指定格式日期
    public String getFormatUserDate(){
        if (getUserDate() == null){
            return "未填写";
        }
        return MyUtil.getDateByFormat("yyyy-MM-dd", userDate);
    }

    public void setUserDate(Date userDate) {
        this.userDate = userDate;
    }
}